package com.xz.http;

import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpRequestBase;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 14-8-9
 * Time: 下午9:59
 * To change this template use File | Settings | File Templates.
 */
public class HttpMethod {
    private HttpGet get;

    public HttpGet httpGet(String url){
        if(get == null){
            get = new HttpGet(url);
            get.addHeader("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
            get.addHeader("Accept-Encoding","gzip,deflate,sdch");
            get.addHeader("Accept-Language","zh-CN,zh;q=0.8");
            get.addHeader("User-Agent","Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36");
        }
        return get;
    }
}
